<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="打印表格(函数).js" type="text/javascript"></script>
    <script type="text/javascript">
        // 脏话过滤，替换敏感词汇
        var str = "贱人的生活方式就是，只许自己拉屎，不许别人放屁";
        var arr = ["贱人","拉屎","屁"];
        for(var i=0;i<arr.length;i++){
            str = str.replace(arr[i],"**");
        }
        console.log(str);

        // 进阶版脏话过滤
        var arrStr = [
            "但并无差别无碍u红撒蓄电池阿虎haunted我才去的的",
            "贱人的生活方式就是，只许自己拉屎，不许别人放屁",
            "岑我iu红IQ嗯u你是看为悲催啊i网呗UIUS下"
        ];
        var arr1 = ["贱人","拉屎","屁","悲催"];
        for(var i=0;i<arrStr.length;i++){
            for(var j=0;j<arr1.length;j++){
                arrStr[i] = arrStr[i].replace(arr1[j],"**");
            }
        }
        console.log(arrStr);


    </script>

</head>
<body>

</body>
</html>